package com.steakliu.sun.common.util;

import java.net.InetAddress;
import java.net.SocketAddress;
import java.net.UnknownHostException;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2023-01-13  22:57
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
public class IpUtil {

    private static InetAddress inetAddress;

    static {
        try {
            inetAddress = InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }

    public static String getHost(){
        return inetAddress.getHostAddress();
    }

}
